#!/usr/bin/python2

import sys
import os

def usage():
    print "help here"

try:
    assert len(sys.argv) >= 2
except:
    usage()
    sys.exit(1)

cmd = sys.argv[1]
if cmd == 'clean':
    for dirpath, dirnames, filenames in os.walk('.'):
        for f in filenames:
            if f.endswith('.pyc'):
                print 'removing', f
                os.remove(dirpath + '/' + f)
elif cmd == 'run':
    sys.path.insert(0, os.getcwd())
    import nanaki
    nanaki.start('webremote')
elif cmd == 'help':
    usage()
elif cmd == 'create':
    import nanaki
    name = sys.argv[2]
    nanaki.create(name)
